/**************************************************
 * thermal.cpp
 **************************************************/

#include "thermal.h"
#include "main.h"
#include "globals.h"

bool isThermalEnabled = false;

void thermalEnable()
{
	if (!isThermalEnabled) {
		isThermalEnabled = true;
		WriteMemory(dwThermalVision1, nopTwo, 2);
		WriteMemory(dwThermalVision2, jmp, 1);
		WriteMemory(dwBlackWhiteFix, nopSix, 6);
	}
}

void thermalDisable()
{
	if (isThermalEnabled) {
		isThermalEnabled = false;
		WriteMemory(dwThermalVision1, bThermalVision1, 2);
		WriteMemory(dwThermalVision2, bThermalVision2, 1);
		WriteMemory(dwBlackWhiteFix, bBlackWhiteFix, 6);
	}
}

void thermalToggle()
{
	if (isThermalEnabled)
		thermalDisable();
	else
		thermalEnable();
}